﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = "/";
%>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>活动统计</title>
  <style>
    .jfw-overall-statistics {}

    .activity-list {
      width: 100%;
      padding-left: 0;
      margin: 0;
      list-style: none;
      padding-bottom: 50px;
      border-bottom: 1px solid #000;
    }

    .activity-list:after {
      content: '';
      display: block;
      clear: both;
    }

    .activity-list .activity-li {
      width: 31%;
      float: left;
      border: 1px solid #000;
      margin-right: 2%;
      text-align: center;
      margin-top: 26px;
    }

    .number {
      color: red;
      font-size: 20px;
    }

    .goods-number {
      height: 140px;
    }

    .goods-number p {
      margin-top: 20px;
      margin-bottom: 20px;
    }

    .goods-total {
      height: 260px;
    }

    .good-name {
      margin-top: 18px;
    }

    .good-img {
      margin-left: auto;
      margin-right: auto;
      margin-top: 10px;
      width: 110px;
      height: 108px;
    }

    .good-img img {
      width: 100%;
    }

    .deal-number,
    .total {
      color: red;
      font-size: 18px;
    }

    .deal-number {
      margin-top: 10px;
    }

    .total {
      margin-bottom: 10px;
    }

    .reward-title {
      padding-top: 40px;
      padding-bottom: 24px;
      font-weight: bold;
      font-size: 18px;
      text-align: center;
    }

    .reward-list {
      list-style: none;
      width: 100%;
    }

    .reward-list:after {
      content: '';
      display: block;
      clear: both;
    }

    .reward-li {
      float: left;
      width: 22%;
      margin-bottom: 10px;
      height: 140px;
      margin-right: 20px;
      border: 1px solid #000;
      text-align: center;
    }

    .reward-li p {
      margin-top: 20px;
      margin-bottom: 20px;
    }
     .pareny a.active{
    background: #00FF00!important;
    border-color:#00FF00!important;
    }
  </style>
    <base href="/">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../../system/index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
</head>

<body style="background:#fff;">
<form action="goldBowl/wholeDetails" method="post"
	name="userForm" id="userForm">
	<input type="hidden" name="times" id="times">
	<input type="hidden" id="startTime" value="${pd.startTime }">
	<input type="hidden" id="endTime" value="${pd.endTime }">
	<table class="table" style="margin-top: 5px;width:1000px;">
	<tr>
		<td class="pareny">
		<a class="btn btn-xs" 
			onclick="times(1);">
			今天
		</a>&nbsp;&nbsp;
		<a class="btn btn-xs" 
			onclick="times(2);">
			昨天
		</a>&nbsp;&nbsp;
		<a class="btn btn-xs" 
			onclick="times(3);">
			前天
		</a>&nbsp;&nbsp;
		<a class="btn btn-xs" 
			onclick="times(4);">
			近7天
		</a>&nbsp;&nbsp;
		<a class="btn btn-xs" 
			onclick="times(5);">
			近30天
		</a>&nbsp;&nbsp;&nbsp;自定义时间:&nbsp;
		<input class="span10 date-picker" name="startTime"
          value="${pd.startTime }"
          type="text" data-date-format="yyyy-mm-dd"
          style="width:88px;" placeholder="开始时间"
          title="开始时间"/>-
        <input class="span10 date-picker" name="endTime"
            type="text" value="${pd.endTime }"
          data-date-format="yyyy-mm-dd"
          style="width:88px;" placeholder="结束时间"
          title="结束时间"/>&nbsp;&nbsp;&nbsp;
          <a class="btn btn-light btn-xs" onclick="searchs();" title="检索"><i
			id="nav-search-icon"
			class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a>
		</td>
	</tr>
</table>
	
  <div class="jfw-overall-statistics">
    <ul class="activity-list">
      <li class="activity-li goods-number">
        <p>注册并参与金饭碗活动的邀请者</p>
        <p class="number"><c:if test="${info.pNum ==null || info.pNum ==''}">0&nbsp;人</c:if>
        <c:if test="${info.pNum !=null && info.pNum !=''}"> ${info.pNum }&nbsp;人</c:if>
       </p>
        <a href="javascript:void()" onclick="person()">查看详情</a>
      </li>
      <li class="activity-li goods-number">
        <p>卖出金饭碗商品</p>
        <p class="number">
        <c:if test="${info.goodsNum ==null || info.goodsNum ==''}">0&nbsp;件</c:if>
        <c:if test="${info.goodsNum !=null && info.goodsNum !=''}">${info.goodsNum }&nbsp;件</c:if>
        </p>
        <a href="javascript:void()" onclick="piece()">查看详情</a>
      </li>
      <li class="activity-li goods-number">
        <p>卖出金饭碗商品金额</p>
        <p class="number">
        <c:if test="${info.price ==null || info.price ==''}">0&nbsp;元</c:if>
        <c:if test="${info.price !=null && info.price !=''}">${info.price }&nbsp;元</c:if>
        </p>
        <a href="javascript:void()" onclick="price()">查看详情</a>
      </li>
      <c:choose>
		<c:when test="${not empty goodsInfo}">
			<c:forEach items="${goodsInfo}" var="user" varStatus="vs">
				 <li class="activity-li goods-total">
			        <div class="good-name">${user.title }</div>
			        <div class="good-img">
			          <img src="${user.thumb }" alt="">
			        </div>
			        <div class="deal-number">成交&nbsp;
			         <c:if test="${user.num ==null || user.num ==''}">0</c:if>
			          <c:if test="${user.num !=null && user.num !=''}">${user.num}</c:if>
			        &nbsp;件</div>
			        <div class="total">总金额&nbsp;
			        <c:if test="${user.price ==null || user.price ==''}">0</c:if>
			        <c:if test="${user.price !=null && user.price !=''}">${user.price }</c:if>
			        &nbsp;元</div>
			        <a href="javascript:void()" onclick="goodsId('${user.id}')">查看详情</a>
			      </li>
			</c:forEach>
		</c:when>
	</c:choose>
    </ul>
     <div class="reward">
      <div class="reward-title">截止目前邀请达成情况：</div>
      <ul class="reward-list">
        <li class="reward-li">
          <p>未达成10人奖励</p>
          <p class="number">${number.z }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('1','10')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成10人奖励</p>
          <p class="number">${number.a }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('10','50')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成50人奖励</p>
          <p class="number">${number.b }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('50','100')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成100人奖励</p>
          <p class="number">${number.c }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('100','500')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成500人奖励</p>
          <p class="number">${number.d }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('500','1000')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成1000人奖励</p>
          <p class="number">${number.e }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('1000','5000')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成5000人奖励</p>
          <p class="number">${number.f }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('5000','10000')">查看详情</a>
        </li>
        <li class="reward-li">
          <p>达成10000人奖励</p>
          <p class="number">${number.g }&nbsp;人</p>
          <a href="javascript:void()" onclick="number('10000','-1')">查看详情</a>
        </li>
      </ul>
    </div> 
  </div>
  </form>
   <!-- 页面底部js¨ -->
	<%@ include file="../../system/index/foot.jsp"%>
	<!-- 删除时确认窗口 -->
	<script src="static/ace/js/bootbox.js"></script>
	<!-- ace scripts -->
	<script src="static/ace/js/ace/ace.js"></script>
	<!-- 日期框 -->
	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
	<!-- 下拉框 -->
	<script src="static/ace/js/chosen.jquery.js"></script>
	<script src="https://cdn.bootcss.com/Chart.js/2.7.2/Chart.bundle.min.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	<script type="text/javascript" src="https://chartjs.bootcss.com/samples/utils.js"></script>
</body>
<script type="text/javascript">
$(top.hangge());
$(function(){
	$('.date-picker').datepicker({autoclose: true,todayHighlight: true});
	 var times=${pd.times}
	 $('.pareny a').eq(times-1).addClass('active')
})
function times(ids){
	$("#times").val(ids);
	$("#userForm").submit();
}
function searchs(){
	$("#userForm").submit();
}
function person(){
	 startTime=$("#startTime").val();
     endTime=$("#endTime").val();
	window.location.href='/goldBowl/listActivity.do?sort=01&startTime='+startTime+'&endTime='+endTime+'&kd=1';
}
function piece(){
	 startTime=$("#startTime").val();
     endTime=$("#endTime").val();
	window.location.href='/goldBowl/workOff.do?startTime='+startTime+'&endTime='+endTime+'&kd=1';
}
function price(){
	 startTime=$("#startTime").val();
     endTime=$("#endTime").val();
	window.location.href='/goldBowl/workOff.do?startTime='+startTime+'&endTime='+endTime+'&kd=1';
}
function goodsId(id){
	 startTime=$("#startTime").val();
    endTime=$("#endTime").val();
	window.location.href='/goldBowl/workOff.do?startTime='+startTime+'&endTime='+endTime+'&goodsId='+id+'&kd=1';
}
function number(snum,mnum){
	window.location.href='/goldBowl/listActivity.do?sort=01&snum='+snum+'&mnum='+mnum+'&kd=1';
}


</script>
</html>
